home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 182_01 / local.h < prev    next >
Text File  |  1990-07-30  |  4KB  |  153 lines

  1. /*  HEADER:     CUGaaa.bb;
  2.     FILENAME:   local.h;
  3.     TITLE:      Local Header;
  4.     COMPILERS:  C86, Lattice C, unix/3 C, unix/5 C;
  5.     SYSTEM:     ms-dos, unix/3, unix/5;
  6.     AUTHORS:    Bill Rogers;
  7.     VERSION:    3.01;
  8.     DATE:       05/09/1985;
  9.     KEYWORDS:   stdio.h, ms-dos, unix, header, uniform;
  10.     SEE-ALSO:   cmodem;
  11.     DESCRIPTION:
  12.        "This file plus 'stdio.h' should result in the same interface
  13.         independent of the computer, operating system or C compiler!
  14.         Note the type names that can be redefined for different
  15.         environments (courtesy Computer Innovations)."
  16.     REFERENCES: C Language Bulletin;
  17.  */
  18. /*--------------------------------------------------------------------*/
  19. /*  INCLUDE */
  20. #include <stdio.h>
  21. /*--------------------------------------------------------------------*/
  22.  
  23. /*  Environment */
  24.  
  25. #define L8086                   /*  3B2, PLEXUS, XT or L8086 */ 
  26. #define MS_DOS                  /*  MS_DOS, PC_DOS or UNIX */ 
  27. #define C86                     /*  C86 or UNIX_C */ 
  28. #define HZ1500                  /*  VT100, TV950, HZ1500 or ANSI */
  29.  
  30. /*  Switch character on command line. */
  31.  
  32. #ifdef  PC_DOS
  33. #define switchar        '\/'
  34. #ifdef  MS_DOS
  35. #define switchar        '\/'  
  36. #endif
  37. #ifdef  UNIX
  38. #define switchar        '-'     
  39. #endif
  40.  
  41. /*  Lower Case Versions of Upper Case Definitions Given in stdio.h */
  42.  
  43. #ifdef  C86
  44. #ifdef  _C86_BIG
  45. #define null             (0l)
  46. #else
  47. #define null             0
  48. #endif
  49. #define file             FILE
  50. #endif
  51.  
  52. #ifdef  UNIX_C
  53. #define null             0
  54. #define file             struct _iobuf
  55. #endif
  56.  
  57. #define eof              (-1)
  58. #define eos              '\0'
  59. #define error            0                
  60.  
  61. #ifdef  C86
  62. #define aread            0
  63. #define awrite           1
  64. #define aupdate          2
  65. #define bread            4
  66. #define bwrite           5
  67. #define bupdate          6
  68. #endif
  69.  
  70. /*  Types */
  71.  
  72. #define bool            int       /*  boolean */
  73. #define enum            int       /*  enumeration */
  74. #define metachar        short int /*  return char or flag */
  75. #define string          char      /*  character string */
  76. #define void            int       /*  return void (procedure) */
  77.  
  78. #define false           0                
  79. #define true            1
  80.  
  81. #ifdef  C86
  82. #define SCHAR           char
  83. #define UCHAR           unsigned char
  84. #define CHAR            char
  85. #define SSHORT          short int
  86. #define USHORT          unsigned short int
  87. #define SINT            int
  88. #define UINT            unsigned int
  89. #define SLONG           long int
  90. #define ULONG           unsigned long int
  91. #define FLOAT           float
  92. #define DOUBLE          double
  93. #endif
  94.  
  95. #ifdef  UNIX_C
  96. #define SCHAR           char
  97. #define UCHAR           unsigned char
  98. #define SSHORT          short int
  99. #define USHORT          unsigned short int
  100. #define SLONG           long int
  101. #define ULONG           unsigned long int
  102. #define SINT            int
  103. #define UINT            unsigned int
  104. #endif
  105.  
  106. /* Open Stream File Modes */
  107.  
  108. #define openread         "r"
  109. #define openupd          "r+"
  110. #define creawrit         "w"
  111. #define creaupd          "w+"
  112. #define apndwrit         "a"
  113. #define apndupd          "a+"
  114.  
  115. #ifdef  C86
  116. #define opnreadb         "rb"
  117. #define opnupdb          "rb+"
  118. #define crewritb         "wb"
  119. #define creupdb          "wb+"
  120. #define apnwritb         "ab"
  121. #define apnupdb          "ab+"
  122. #define console          "CON:"
  123. #define printer          "PRN:"
  124. #endif
  125.  
  126. #ifdef  UNIX_C
  127. #define opnreadb         "r"
  128. #define opnupdb          "r+"
  129. #define crewritb         "w"
  130. #define creupdb          "w+"
  131. #define apnwritb         "a"
  132. #define apnupdb          "a+"
  133. #endif
  134.  
  135. /*  Preprocessor 'Functions' */
  136.  
  137. #define abs(x)           ((x) >= (0) ? (x) : (-x))
  138. #define max(x,y)         ((x) >= (y) ? (x) : ( y))
  139. #define min(x,y)         ((x) <= (y) ? (x) : ( y))
  140.  
  141. /*  External Definitions */
  142.  
  143. #ifdef C86
  144. extern  file             *fopen();
  145. extern  file             *freopen();
  146. extern  long int         ftell();
  147. extern  char             *fgets();
  148. extern  char             *gets();
  149. #endif
  150. /*--------------------------------------------------------------------*/
  151. /*  end local.h */
  152. /*--------------------------------------------------------------------*/
  153.